from enum import Enum

class ExceptionEnum(Enum):

    INVALID_TOKEN = ("E0401", "Invalid Token")
    INVALID_TOKEN_FIELD = ("E0422", "Invalid Token Field")
    NOT_FOUND = ("E0404", "Not Found")
    METHOD_NOT_ALLOWED = ("E0405", "Method Not Allowed")
    INTERNAL_ERROR = ("E0500", "Internal Server Error")
    UNKNOWN_ERROR = ("E1000", "Unknown Error")
    PARAMS_VALIDATION_FAILED = ("E1001", "Params Validation Failed")
    NO_COMPANY = ("E1002", "No Company")
    PROGRESS_FAILED = ("E1003", "Progress Failed")
    BILL_OF_LADING_CHECKED_FAILED = ("E1004", "Bill Of Lading Checks Failed")
    NO_DATA_FOUND = ("E1005", "No Data Found")
    UNDEFINED_CRAWLER_TYPE_ERROR = ("E1006", "Undefined Crawler Type")
    CRAWLER_RESULT_NULL_ERROR = ("E1007", "Crawler Result Null Error")
    VERIFICATION_CODE_ERROR = ("E1008", "Verification Code Error")
    WEB_PAGE_LOAD_FAILED = ("E1009", "Web Page Load Failed")
    CRAWLER_EXEC_RATE_TOO_HIGH = ("E1010", "Crawler Exe Rate too high")
    BOOKING_CANCELED_FAILED = ("E1011", "Booking Canceled")
    CRAWLER_ID_NOT_FOUND_ERROR = ("E1012", "Crawler ID Not Found")
    CRAWLER_TIMES_MORE_THAN_MAX_TIMES = ("E1013", "Crawler Times More than Max Times")


    def __init__(self, code: str, msg: str):
        self.code = code
        self.msg = msg

